// 点击改变方向的按钮的时候,方向发生改变
function changeDirection() {
    var start = document.getElementById('start')
    var end = document.getElementById('end')
    var direction = document.getElementById('direction')
    if (direction.value == 0) {
        direction.value = 1;
        var start_ = start.innerHTML;
        var end_ = end.innerHTML;
        start.innerHTML = end_;
        end.innerHTML = start_
    } else {
        direction.value = 0;
        var start_ = start.innerHTML;
        var end_ = end.innerHTML;
        start.innerHTML = end_;
        end.innerHTML = start_
    }
}